home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / DOpus_SDK_5.5 / docs / timer.doc < prev   
Text File  |  1996-09-07  |  5KB  |  192 lines

  1. TABLE OF CONTENTS
  2.  
  3. dopus5.library/AllocTimer
  4. dopus5.library/CheckTimer
  5. dopus5.library/FreeTimer
  6. dopus5.library/GetTimerBase
  7. dopus5.library/StartTimer
  8. dopus5.library/StopTimer
  9. dopus5.library/TimerActive
  10. dopus5.library/AllocTimer                           dopus5.library/AllocTimer
  11.  
  12.     NAME
  13.         AllocTimer - allocate a timer handle
  14.  
  15.     SYNOPSIS
  16.         AllocTimer(unit, port)
  17.                     D0    A0
  18.  
  19.         TimerHandle *AllocTimer(ULONG, struct MsgPort *);
  20.  
  21.     FUNCTION
  22.         This function allocates a timer handle to enable easy use of the
  23.         timer.device. You can supply a message port for it to use,
  24.         or have it create one for you. If you do not supply a message port,
  25.         the "port" field of the returned TimerHandle structure contains
  26.         the address of the port that was created for you.
  27.  
  28.     INPUTS
  29.         unit - the timer.device unit you wish to use (eg UNIT_VBLANK)
  30.         port - message port to use (or NULL to have one created)
  31.  
  32.     RESULT
  33.         Returns a TimerHandle to use with the other functions.
  34.  
  35.     SEE ALSO
  36.         FreeTimer(), StartTimer()
  37.  
  38. dopus5.library/CheckTimer                           dopus5.library/CheckTimer
  39.  
  40.     NAME
  41.         CheckTimer - see if a timer request has completed
  42.  
  43.     SYNOPSIS
  44.         CheckTimer(handle)
  45.                      A0
  46.  
  47.         BOOL CheckTimer(TimerHandle *);
  48.  
  49.     FUNCTION
  50.         This function allows you to discover if a timer request you have
  51.         started has completed.
  52.  
  53.     INPUTS
  54.         handle - timer handle
  55.  
  56.     RESULT
  57.         Returns TRUE if the request is complete, or FALSE if it has not
  58.         completed or is invalid.
  59.  
  60.     SEE ALSO
  61.         StartTimer(), StopTimer()
  62.  
  63. dopus5.library/FreeTimer                             dopus5.library/FreeTimer
  64.  
  65.     NAME
  66.         FreeTimer - free a timer handle
  67.  
  68.     SYNOPSIS
  69.         FreeTimer(handle)
  70.                     A0
  71.  
  72.         void FreeTimer(TimerHandle *);
  73.  
  74.     FUNCTION
  75.         This function frees a timer handle created with AllocTimer(). Any
  76.         outstanding request is aborted automatically. If you supplied your
  77.         own message port to the AllocTimer() function, you are responsible
  78.         for deleting the port yourself.
  79.  
  80.     INPUTS
  81.         handle - timer handle
  82.  
  83.     SEE ALSO
  84.         AllocTimer()
  85.  
  86. dopus5.library/GetTimerBase                       dopus5.library/GetTimerBase
  87.  
  88.     NAME
  89.         GetTimerBase - get a pointer to the timer.device library base
  90.  
  91.     SYNOPSIS
  92.         GetTimerBase()
  93.  
  94.         struct Library *GetTimerBase(void);
  95.  
  96.     FUNCTION
  97.         This function returns a pointer to the library base of the
  98.         timer.device. The library base pointer is needed if you want to call
  99.         any of the library functions of the timer.device. This routine saves
  100.         you having to open the timer.device to get this base pointer.
  101.  
  102.     INPUTS
  103.         none
  104.  
  105.     RESULT
  106.         Returns struct Library * pointer. You must NOT call CloseLibrary() on
  107.         this pointer.
  108.  
  109. dopus5.library/StartTimer                           dopus5.library/StartTimer
  110.  
  111.     NAME
  112.         StartTimer - send a timer request
  113.  
  114.     SYNOPSIS
  115.         StartTimer(handle, seconds, micros)
  116.                      A0       D0      D1
  117.  
  118.         void StartTimer(TimerHandle *, ULONG, ULONG);
  119.  
  120.     FUNCTION
  121.         This function starts a timer request for a given period of time.
  122.         Your code should wait on "handle->port" for a signal indicating a
  123.         completed request. You can call CheckTimer() at any time to see if
  124.         the request has been completed.
  125.  
  126.     INPUTS
  127.         handle - timer handle
  128.         seconds - number of seconds for the request
  129.         micros - number of microseconds (0-999999)
  130.  
  131.     NOTES
  132.         You can call this routine with a request already pending; the first
  133.         request will automatically be aborted.
  134.  
  135.     SEE ALSO
  136.         AllocTimer(), StopTimer(), CheckTimer()
  137.  
  138. dopus5.library/StopTimer                             dopus5.library/StopTimer
  139.  
  140.     NAME
  141.         StopTimer - stop a timer request in progress
  142.  
  143.     SYNOPSIS
  144.         StopTimer(handle)
  145.                     A0
  146.  
  147.         void StopTimer(TimerHandle *);
  148.  
  149.     FUNCTION
  150.         This function aborts a timer request that was previously started
  151.         with StartTimer(). If the request has already completed, this
  152.         function simply does the cleanup.
  153.  
  154.     INPUTS
  155.         handle - timer handle
  156.  
  157.     SEE ALSO
  158.         AllocTimer(), StartTimer(), CheckTimer()
  159.  
  160. dopus5.library/TimerActive                         dopus5.library/TimerActive
  161.  
  162.     NAME
  163.         TimerActive - check if a timer request is pending
  164.  
  165.     SYNOPSIS
  166.         TimerActive(handle)
  167.                       A0
  168.  
  169.         BOOL TimerActive(TimerHandle *);
  170.  
  171.     FUNCTION
  172.         If you lose track of (or can't be bothered keeping track of)
  173.         whether or not you have a pending timer request, this function
  174.         allows you to find out.
  175.  
  176.         This function is actually not really necessary. All the timer
  177.         functions are robust enough to cope with multiple requests
  178.         (a StartTimer() with an already-pending request), or a StopTimer()
  179.         when a request is already complete (or was never sent), or any of
  180.         the other "error" conditions that the timer.device is usually
  181.         sensitive to.
  182.  
  183.     INPUTS
  184.         handle - timer handle
  185.  
  186.     RESULT
  187.         Returns TRUE if there is a request pending.
  188.  
  189.     SEE ALSO
  190.         AllocTimer()
  191.  
  192.